Basics of Databases

Get a quick introduction to databases.

Data#

Data is facts about any object under evaluation. For example, let’s review the features of an imaginary park bench.

We could state that the bench has the following attributes:

  • It’s green
  • It has shaky legs
  • It’s rusty

All of these characteristics are data about the park bench.

Databases#

Databases are data containers. Assume we have a jar of cookies; that jar is the database because it contains the cookies, and the cookies are the data. Databases can store various types of data, just like how we can keep various types of cookies in the same jar: chocolate, milk chocolate, and mango (mango cookies? yum!).

A database’s five major components are data, query language, hardware, software, and the system:

  • Data: The information that the database must manage and process. For example, data could be information about students or faculty in a university department.

  • Query language: A collection of instructions that enables us to control and manage a database’s content. For instance, instructions to add new data, modify existing data, read data, and even delete data. SQL is an example of a database language.

  • Procedures: Guidelines for database users.

  • Hardware: Consists of computer systems that store and maintain databases.

  • Software: The primary element. It comprises the applications needed to access the data as well as the operating system, network software, and database software that’s utilized to share the data with other users.

svg viewer

Relational databases#

Relational databases hold data that’s connected together. This data is organized in tables (with columns and rows).

The language used to interface with relational databases is called Structured Query Language (SQL). Data CRUD processes like add, read, update, and delete are carried out using SQL. It controls every part of the database. MySQL, PostgreSQL, MariaDB, Microsoft SQL Server, Oracle, and Amazon Aurora are examples of relational databases.

svg viewer

Non-relational databases#

Non-relational databases are databases that don’t have a predefined schema. They make use of documents to store data rather than relational tables. They’re also called NoSQL databases. The primary application of a NoSQL database is for distributed data stores with large data storage requirements. Big data and real-time web apps use NoSQL. The acronym NoSQL stands for Not Only SQL or Not SQL. They store structured, semi-structured, and unstructured data. Examples of NoSQL databases are:

  • Document-oriented databases (e.g., MongoDB)
  • Key-value stores (e.g., Redis)
  • Wide-column databases (e.g., Cassandra)
  • Graph databases (e.g., FlockDB)
svg viewer

Quiz on the Basics of Go Language

Comparing SQL and NoSQL